<?php
/* @var $this ProfessionController */
/* @var $model Profession */


$this->breadcrumbs=array(
	//Yii::t('default','Professions')=>array('index'),
	Yii::t('profession_messages','profession.manage'),
);

$this->menu=array(
	array('label'=>Yii::t('profession_messages','profession.create'), 'url'=>array('create')),
	array('label'=>Yii::t('profession_messages','profession.viewAll'), 'url'=>array('index')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#profession-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>


<h1><?php echo Yii::t('profession_messages','profession.manage'); ?></h1>

<?php echo CHtml::link(Yii::t('user_messages','advanced.search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'profession-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'name',

		array(
				'name'=>'professionType_id',
				'value'=>'$data->professionTypeString',
				'filter'=>false,
		),

		array(
				'name'=>'state_id',
				'value'=>'$data->stateString',
				'filter'=>false,
		),
		
		array(
				'name'=>'region_id',
				'value'=>'$data->regionString',
				'filter'=>false,
		),
	
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
		),
	),
)); ?>